﻿@model MenuModel
@using Nop.Web.Models.Common;

@{
    //current category ID
    int currentCategoryId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("category", StringComparison.InvariantCultureIgnoreCase))
    {
        currentCategoryId = Convert.ToInt32(Url.RequestContext.RouteData.Values["categoryId"].ToString());
    }


    //current manufacturer ID
    int currentManufacturerId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("manufacturer", StringComparison.InvariantCultureIgnoreCase))
    {
        currentManufacturerId = Convert.ToInt32(Url.RequestContext.RouteData.Values["manufacturerId"].ToString());
    }


    //current product ID
    int currentProductId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("product", StringComparison.InvariantCultureIgnoreCase))
    {
        currentProductId = Convert.ToInt32(Url.RequestContext.RouteData.Values["productId"].ToString());
    }
}

@*<ul class="top-menu">
    @Html.Widget("header_menu_before")
    <li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>
    @if (Model.RecentlyAddedProductsEnabled)
    {
        <li><a href="@Url.RouteUrl("RecentlyAddedProducts")">@T("Products.NewProducts")</a>
        </li>
    }
    <li><a href="@Url.RouteUrl("ProductSearch")">@T("Search")</a> </li>
    <li><a href="@Url.RouteUrl("CustomerInfo")">@T("Account.MyAccount")</a></li>
    @if (Model.BlogEnabled)
    {
        <li><a href="@Url.RouteUrl("Blog")">@T("Blog")</a></li>
    }
    @if (Model.ForumEnabled)
    {
        <li><a href="@Url.RouteUrl("Boards")">@T("Forum.Forums")</a></li>
    }
    <li><a href="@Url.RouteUrl("ContactUs")">@T("ContactUs")</a></li>
    @Html.Widget("header_menu_after")
</ul>*@

@Html.Action("CategoryNavigation", "Catalog", new { currentCategoryId = currentCategoryId, currentProductId = currentProductId })